package com.phone.client.controller;

import com.seventh.common.pojo.R;
import com.phone.client.poji.vo.CouRecordVo;
import com.phone.client.service.CouRecordService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: clms-seventh
 * @description: 优惠券记录的控制层
 * @author: 杨佳琪
 * @create: 2021-07-24 19:17
 **/
@RestController
@RequestMapping("client/courec")
@Api(tags="优惠券记录控制层")
public class CouRecordController {
    @Resource
    private CouRecordService couRecordService;

    @ApiOperation("分页查询")
    @PostMapping("initCourecTable/{currentPage}/{pageSize}")
    public R initCourecTable(@ApiParam(value = "页码",name = "currentPage") @PathVariable("currentPage") Integer currentPage,@ApiParam(value = "条数",name = "pageSize") @PathVariable("pageSize") Integer pageSize,
                             @RequestBody CouRecordVo couRecordVo) {
        return couRecordService.findCouRecordById(currentPage, pageSize, couRecordVo);
    }


    @ApiOperation("删除")
    @DeleteMapping("deleteCourec/{id}")
    public R deleteCourec(@PathVariable Integer id) {
        return couRecordService.deleteCourec(id);
    }
}
